From bcba3bd97577458ec8dc6ed51f2b59f9b9de059e Mon Sep 17 00:00:00 2001 From: robertl Date: Thu, 7 Apr 2005 20:14:38 +0000 Subject: [PATCH] Add runtime test that endpoints were correctly parsed. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@1129 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/jeeps/gpslibusb.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/gpsbabel/jeeps/gpslibusb.c b/gpsbabel/jeeps/gpslibusb.c index fb90ce8c5..dadab59b4 100644 --- a/gpsbabel/jeeps/gpslibusb.c +++ b/gpsbabel/jeeps/gpslibusb.c @@ -54,7 +54,7 @@ static void garmin_usb_syncup(void); gusb_init(void) { -//usb_set_debug(99); +// usb_set_debug(99); usb_init(); usb_find_busses(); usb_find_devices(); @@ -183,7 +183,15 @@ garmin_usb_start(struct usb_device *dev) } } - garmin_usb_syncup(); + /* + * Zero is the configuration endpoint, so if we made it through + * that loop without non-zero values for all three, we're hosed. + */ + if (gusb_intr_in_ep && gusb_bulk_in_ep && gusb_bulk_out_ep) { + garmin_usb_syncup(); + } else { + fatal("Could not identify endpoints on USB device.\nFound endpoints Intr In %d Bulk Out %d Bulk In %d\n", gusb_intr_in_ep, gusb_bulk_out_ep, gusb_bulk_in_ep); + } return; } -- 2.30.2